package org.fisco.bcos.asset.service.impl;



import java.math.BigInteger;

import lombok.SneakyThrows;
import org.fisco.bcos.asset.client.CharityDonationClient;

import org.fisco.bcos.asset.resp.BuildProject;
import org.fisco.bcos.asset.service.CharityOrgService;
import org.fisco.bcos.sdk.model.TransactionReceipt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CharityOrgServiceImpl extends CharityServiceImpl implements CharityOrgService {

    @Autowired
    private CharityDonationClient charityDonationClient;

    @Override
    public BuildProject createDonationProject(String projectName, String description,
                                              String beneficiaryAddress, BigInteger targetAmount) {
        return charityDonationClient.createDonationProject(projectName, description, beneficiaryAddress, targetAmount);
    }

    @Override
    public void setRegulator(String regulatorAddress) {
         charityDonationClient.setRegulator(regulatorAddress);
    }

    @Override
    public void setBeneficiary(String beneficiaryAddress) {
        charityDonationClient.registerBeneficiary(beneficiaryAddress);
    }

    @Override
    public void approveApplication(BigInteger applicationId) {
         charityDonationClient.approveApplication(applicationId);
    }
}